import React, { useState } from 'react'
export default function App1() {
  const [count, setCount] = useState(0)
  const [isHot, setIsHot] = useState(true)
  const [person, setPerson] = useState(["张三", "李四", "王五"])
  const setCountHandle = () => {
    setCount(count + 1)
  }
  const setIsHotHandle = () => {
    setIsHot(!isHot)
  }
  return (
    <div>
      <h1>累加的值是{count}</h1>
      <h2>天气真的{isHot ? '热啊' : '冷啊'}</h2>
      <ul>
        {

          person.map((item) => {
            return <li key={item}>{item}</li>
          })

        }
      </ul>

      <button onClick={setCountHandle}>累加</button>
      <button onClick={setIsHotHandle}>改变</button>
    </div>
  )
}
